﻿@using WineStore.Extends;
@using PagedList.Mvc;
@using PagedList;
@model PagedList.IPagedList<WineStore.Models.LinkWebsite>
@{
    ViewBag.Title = "ShowLinkWebsite";
    Layout = "~/Views/Shared/AdminLayout.cshtml";
}
@*@section Styles
{
    <!--Sử dụng cho paging-->
    <link href="../../Content/PagedList.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        td
        {
            text-align: center;
            vertical-align: middle;
        }
    </style>
}*@
@section Styles
{
    <!--Sử dụng cho autocomplete-->
    <link href="../../Content/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
    <!--Sử dụng cho paging-->
    <link href="../../Content/PagedList.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        input, textarea, select {
            padding: 5px;
            border: 1px solid #ccc;
            border-radius: 3px;
            width: 200px;
            color: #333;
            box-shadow: rgba(0,0,0,0.1)0px 0px 8px;
            -moz-box-shadow: rgba(0,0,0,0.1)0px 0px 8px;
            -webkit-box-shadow: rgba(0,0,0,0.1)0px 0px 8px;
        }

        textarea {
            width: 400px;
            height: 100px;
            max-width: 400px;
            line-height: 18px;
            border-radius: 3px;
        }


            input:hover, textarea:hover, select:hover input:focus, textarea:focus, select:focus {
                border-color: 10px solid #C9C9C9;
                box-shadow: rgba(0,0,0,0.2)0px 0px 8px;
                -moz-box-shadow: rgba(0,0,0,0.2)0px 0px 8px;
                -webkit-box-shadow: rgba(0,0,0,0.2)0px 0px 8px;
                border-radius: 3px;
            }

        input .submit {
            height: 38px;
            background-color: #474E69;
            color: #FFF;
            border-radius: 3px;
            -moz-border-radius: 3px;
            -webkit-border-radius: 3px;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }
    </style>
}
<link href="../../Content/styletablesim.css" rel="stylesheet" />

@section Scripts
{
    <!--Sử dụng cho row hover-->
    <script type="text/javascript">
        $(document).ready(function () {
            $("tr").not(':first').hover(function () {
                $(this).css("background", "#F0FFFF");
            }, function () {
                $(this).css("background", "");
            }
            );
        });
    </script>
}
<!-- Table (TABLE) -->
@if (Session["Admin"] != null)
{
<h3 class="tit">
    Danh sách liên kết website
</h3>
<div style="color: Red; font-size: 13px;" id="update-message">
</div>
using (Html.BeginForm())
{
    <table style="width:100%; border:1px">
        <tr>
            <th>
                Tiêu đề
            </th>
            <th>
               Địa chỉ Url 
            </th>
            <th>
                Ảnh
            </th>
            <th>
                Sự kiện
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr id="row-@item.LinkWebsiteId">
                <td>
                    @Html.DisplayFor(news => item.LinkWebsiteTitle_VN)
                </td>
                <td>
                    @Html.DisplayFor(news => item.LinkWebsiteUrl)
                </td>
               
                <td>
                    @Html.ImageFor(news => "../../Content/Images/LinkImages/" + item.LinkImage, new { width = "115px", height = "115px", alt = "some alt text" })
                </td>
                <td>
                    @Html.ActionLink("Sửa", "EditLinkWebsites", new { id = item.LinkWebsiteId }, new { @class = "edit" })
                    @Html.ActionLink("Xóa", "DeleteLinkWebsites", new { id = item.LinkWebsiteId }, new { @class = "edit" })
                </td>
            </tr>
        
        }
        <tr>
            <td colspan="4" align="right" style="text-align: right; vertical-align: bottom;">
                @Html.ActionLink("Thêm mới", "CreateLinkWebsites", null, new { @class = "edit" })
            </td>
        </tr>
    </table>
    <!--Paging-->
    @Html.PagedListPager(Model, page => Url.Action("ShowLinkWebsite", new { page = page }), (PagedListRenderOptions)ViewBag.Pro)
}

}
else
{
    Response.Redirect("~/Admin/LogOn/");
}